package org.idea.spring.condition.selfconditioninject;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Author linhao
 * @Date created in 2:40 下午 2021/5/8
 */
public class Application {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext();
        annotationConfigApplicationContext.register(Application.class);
        annotationConfigApplicationContext.register(Config.class);
        annotationConfigApplicationContext.refresh();
        VersionService versionService = annotationConfigApplicationContext.getBean(VersionService.class);
        System.out.println(versionService.getVersion());
        annotationConfigApplicationContext.close();
    }
}
